home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 3.iso / dist / fw_mc.idb / usr / freeware / lib32 / mc / mc.ext.z / mc.ext
Text File  |  2002-07-08  |  14KB  |  558 lines

  1. # Midnight Commander 3.0 extension file
  2. # Warning: Structure of this file has changed completely with version 3.0
  3. #
  4. # All lines starting with # or empty lines are thrown away.
  5. # Lines starting in the first column should have following format:
  6. #
  7. # keyword/descNL, i.e. everything after keyword/ until new line is desc
  8. #
  9. # keyword can be: 
  10. #
  11. #    shell (desc is, when starting with a dot, any extension (no wildcars), 
  12. #          i.e. matches all the files *desc . Example: .tar matches *.tar;
  13. #          if it doesn't start with a dot, it matches only a file of that name)
  14. #
  15. #    regex (desc is an extended regular expression)
  16. #          Please note that we are using the GNU regex library and thus
  17. #          \| matches the literal | and | has special meaning (or) and
  18. #          () have special meaning and \( \) stand for literal ( ).
  19. #
  20. #    type  (file matches this if `file %f` matches regular expression desc
  21. #          (the filename: part from `file %f` is removed))
  22. #
  23. #    directory (matches any directory matching regular expression desc)
  24. #
  25. #    include (matches an include directive)
  26. #
  27. #    default (matches any file no matter what desc is)
  28. #
  29. # Other lines should start with a space or tab and should be in the format:
  30. #
  31. # keyword=commandNL (with no spaces around =), where keyword should be: 
  32. #
  33. #    Open (if the user presses Enter or doubleclicks it), 
  34. #
  35. #    View (F3), Edit (F4), Drop (user drops some files on it) or any other
  36. #
  37. #    user defined name (those will be listed in the extension dependent popup
  38. #    menu). This is not implemented yet for the text edition but will be
  39. #    implemented some day so feel free to add useful actions here.
  40. #
  41. #    Title is the default icon title for objects. %p is expanded into the
  42. #    name of that file and %d/%p to a name with full path. Default title
  43. #    (if none is specified) is %p
  44. #
  45. #    Include is the keyword used to add any further entries from an include/
  46. #    section
  47. #
  48. # command is any one-line shell command, with the following substitutions:
  49. #
  50. # %% -> % character
  51. # %p -> name of the current file (without path, but pwd is its path)
  52. # %f -> name of the current file. Unlike %p, if file is located on a 
  53. #    non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
  54. #    then the file will be temporarily copied into a local directory
  55. #    and %f will be the full path to this local temporal file.
  56. #    If you don't want to get a local copy and want to get the
  57. #    virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
  58. #    use %d/%p instead of %f.
  59. # %d -> name of the current directory (pwd, without trailing slash)
  60. # %s -> "selected files", i.e. space separated list of tagged files if any
  61. #       or name of the current file
  62. # %t -> list of tagged files
  63. # %u -> list of tagged files (they'll be untaged after the command)
  64. #
  65. # (If these 6 letters are in uppercase, they refer to the other panel.
  66. # But you shouldn't have to use it in this file.)
  67. #
  68. #
  69. # %cd -> the rest is a path mc should change into (cd won't work, since it's
  70. #    a child process).  %cd handles even vfs names.
  71. #
  72. # %view -> the command you type will be piped into mc's internal file viewer
  73. #    if you type only the %view and no command, viewer will load %f file
  74. #    instead (i.e. no piping, so it is different to %view cat %f)
  75. #    %view may be directly followed by {} with a list of any of
  76. #    ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for
  77. #    text using backspace for bold and underscore) and unform
  78. #    (no highlighting for nroff sequences) separated by commas.
  79. #
  80. # %var -> You use it like this: %var{VAR:default}.  This macro will expand
  81. #       to the value of the VAR variable in the environment if it's set
  82. #       otherwise the value in default will be used.  This is similar to
  83. #       the Bourne shell ${VAR-default} construct.
  84. #
  85. # %q -> will be replaced with a list of files user dropped on it
  86. #    with full pathnames (only applicable in the Drop command).
  87. #
  88. # Rules are applied from top to bottom, thus the order is important.
  89. # If some actions are missing, search continues as if this target didn't
  90. # match (i.e. if a file matches the first and second entry and View action
  91. # is missing in the first one, then on pressing F3 the View action from
  92. # the second entry will be used. default should catch all the actions.
  93. #
  94. # Any new entries you develop for you are always welcome if they are
  95. # useful on more than one system.  You can send your modifications
  96. # by e-mail to mc-devel@gnome.org
  97.  
  98.  
  99. ### Changes ###
  100. #
  101. # Reorganization: 2000-05-01 Michal Svec <rebel@penguin.cz>
  102.  
  103.  
  104. ### TODO ###
  105. #
  106. # Postscript    Open: ps2svga [gs -DEVICE=jpeg|zgv or something]
  107. # Images        asciiview
  108. # RTF        rtf2html
  109. # All X Apps    [Nothing/Warning] if no DISPLAY
  110. # Not found    [Default/Warning]
  111. # Empty Output    [Default/Warning]
  112. # Edit:        CopyOut+EDIT+CopyIn
  113. # Security    Check gzip/bzip EDIT (mktemp)
  114. # Maybe:    Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc.
  115.  
  116.  
  117. ### Sources ###
  118.  
  119. # C
  120. shell/.c
  121.     Open=%var{EDITOR:vi} %f
  122.     Compile=%var{CC:cc} -O -c %f
  123.     Link=%var{CC:cc} -O -o %d/`basename %f .c` %f
  124.  
  125. # Fortran
  126. shell/.f
  127.     Open=%var{EDITOR:vi} %f
  128.     Compile=f77 -O -c %f
  129.     Compile and Link=f77 -O %f
  130.     
  131. # Header
  132. shell/.h
  133.     Open=%var{EDITOR:vi} %f
  134.  
  135. # Object
  136. shell/.o
  137.     #Open=%var{PAGER:more} %f
  138.     View=%view{ascii} nm %f
  139.     Link=%var{CC:cc} -O %f
  140.     Disassemble=%view{ascii} objdump -d -r %f
  141.  
  142. # Asm
  143. shell/.s
  144.     Open=%var{EDITOR:vi} %f
  145.     Assemble=%var{CC:cc} -O -c %f
  146.     Link=%var{CC:cc} -O -o %d/`basename %f .s` %f
  147.  
  148. # C++
  149. regex/\.(C|cc)$
  150.     Open=%var{EDITOR:vi} %f
  151.     Compile=c++ -O -c %f
  152.     Link=c++ -O -o %d/`basename %f .c` %f
  153.  
  154. ### Documentation ###
  155.  
  156. # Texinfo
  157. regex/\.(te?xi|texinfo)$
  158.  
  159. # GNU Info page
  160. type/^Info\ text
  161.     Open=info -f %f
  162.  
  163. shell/.info
  164.     Open=info -f %f
  165.  
  166. # Manual page
  167. # Exception - .so libraries are not manual pages
  168. regex/\.(so|so\.[0-9\.]*)$
  169.     View=%view{ascii} nm %f
  170.  
  171. regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
  172.     Open=nroff  -man %f | %var{PAGER:more}
  173.     View=%view{ascii,nroff} nroff  -man %f
  174.  
  175. # Troff with me macros.
  176. # Exception - "read.me" is not a nroff file.
  177. shell/read.me
  178.     Open=
  179.     View=
  180.  
  181. shell/.me
  182.     Open=nroff  -me %f | %var{PAGER:more}
  183.     View=%view{ascii,nroff} nroff  -me %f
  184.  
  185. # Troff with ms macros.
  186. shell/.ms
  187.     Open=nroff  -ms %f | %var{PAGER:more}
  188.     View=%view{ascii,nroff} nroff  -ms %f
  189.  
  190. # Manual page - compressed
  191. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
  192.     Open=gzip -dc %f | nroff  -man | %var{PAGER:more}
  193.     View=%view{ascii,nroff} gzip -dc %f | nroff  -man
  194.  
  195. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz$
  196.     Open=bzip -dc %f | nroff  -man | %var{PAGER:more}
  197.     View=%view{ascii,nroff} bzip -dc %f | nroff  -man
  198.  
  199. regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz2$
  200.     Open=bzip2 -dc %f | nroff  -man | %var{PAGER:more}
  201.     View=%view{ascii,nroff} bzip2 -dc %f | nroff  -man
  202.  
  203.  
  204. ### Images ###
  205.  
  206. type/^GIF
  207.     Include=image-options
  208.  
  209. type/^JPEG
  210.     Include=image-options
  211.  
  212. type/^PC\ bitmap
  213.     Include=image-options
  214.  
  215. type/^PNG
  216.     Include=image-options
  217.  
  218. type/^TIFF
  219.     Include=image-options
  220.  
  221. type/^PBM
  222.     Include=image-options
  223.  
  224. type/^PGM
  225.     Include=image-options
  226.  
  227. type/^PPM
  228.     Include=image-options
  229.  
  230. shell/.xbm
  231.     Open=bitmap %f
  232.  
  233. shell/.xpm
  234.     Include=image-options
  235.     View=sxpm %f
  236.  
  237. include/image-options
  238.     Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (ee %f &); fi
  239.     View=%view{ascii} identify %f
  240.     #View=%view{ascii} asciiview %f
  241.     Set root window to this image=background-properties --setwallpaper %f &
  242.     Display this file=ee %f &
  243.  
  244.  
  245. ### Sound files ###
  246.  
  247. regex/\.(wav|WAV|Wav|snd|SND|Snd|voc|VOC|Voc|au|AU|Au)$
  248.        Open=play %f
  249.  
  250. regex/\.(mod|MOD|Mod|s3m|S3M|S3m|xm|XM|Xm)$
  251.        Open=mikmod %f
  252.        #Open=tracker %f
  253.  
  254. regex/\.(wav22|WAV22)$
  255.        Open=vplay -s 22 %f
  256.  
  257. regex/\.(mp3|MP3|Mp3)$
  258.     Open=mpg123 %f
  259.     View=%view{ascii} mpg123 -tn1 %f 2>&1|grep -E "^(Title|Album|Comment|MPEG|$)"
  260.  
  261.  
  262. ### Multimedia ###
  263.  
  264. regex/\.(mpe?g|MPE?G|Mpe?g)$
  265.     Open=mtvp %f 2>/dev/null&
  266.     #Open=mtv %f 2>/dev/null&
  267.     #Open=gtv %f 2>/dev/null&
  268.     #Open=plaympeg %f 2>/dev/null&
  269.     #Open=mpeg_play %f &
  270.     #Open(big)=mpeg_play -dither 2x2 %f &
  271.     #Open(gray)=mpeg_play -dither gray %f &
  272.  
  273. regex/\.(avi|AVI|Avi|mov|MOV|Mov)$
  274.     Open=xanim %f 2>/dev/null&
  275.  
  276. regex/\.(rm|RM|Rm|ram|RAM|Ram)$
  277.     Open=realplay %f&
  278.  
  279.  
  280. ### Documents ###
  281.  
  282. # Postscript
  283. type/^PostScript
  284.     Open=gv %f&
  285.     View=%view{ascii} ps2ascii %f
  286.     View with GhostView=gv %f
  287.  
  288. # PDF
  289. type/^PDF
  290.     Open=xpdf %f&
  291.     #Open=acroread %f&
  292.     #Open=ghostview %f&
  293.     View=%view{ascii} pdftotext %f -
  294.  
  295. # html
  296. regex/\.([Hh]tml?|HTML?)$
  297.     #Open=if echo "%d/%p" | grep ^ftp; then $viewer %d/%p; else $viewer file:%p; fi
  298.     Open=if [ x$DISPLAY = x ]; then lynx -force_html %f; else (netscape %f &); fi
  299.     View=%view{ascii} lynx -dump -force_html %f; 
  300.     Run with AppletViewer=appletviewer %f
  301.     View with netscape=netscape file://%f
  302.  
  303. # StarOffice and OpenOffice
  304. shell/.sdw
  305.     Open=soffice %f
  306.  
  307. # AbiWord
  308. shell/.abw
  309.     Open=abiword %f
  310.  
  311. # Microsoft Word Document
  312. regex/\.([Dd]o[ct]|DO[CT]|[Ww]ri|WRI)$
  313.     View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f
  314. type/^Microsoft\ Word
  315.     View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f
  316.  
  317. # Microsoft Excel Worksheet
  318. regex/\.([Xx]l[sw]|XL[SW])$
  319.     View=%view{ascii} xls2csv %f || strings %f
  320. type/^Microsoft\ Excel
  321.     View=%view{ascii} xls2csv %f || strings %f
  322.  
  323. # Framemaker
  324. type/^FrameMaker
  325.     Open=fmclient -f %f
  326.  
  327. # DVI
  328. regex/\.([Dd]vi|DVI)$
  329.     Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi
  330.     View=%view{ascii} dvi2tty %f
  331.     Convert file to Postscript=dvips %f
  332.  
  333. # TeX
  334. regex/\.([Tt]ex|TEX|TeX)$
  335.     Open=%var{EDITOR:vi} %f
  336.     TeX this file=tex %f
  337.     LaTeX this file=latex %f
  338.  
  339.  
  340. ### Miscellaneous ###
  341.  
  342. shell/^RMAIL$
  343.     Start Emacs on this RMAIL file=emacs %f
  344.     Open=emacs %f
  345.  
  346. type/^(M|m)ail
  347.     Open=elm -f %f
  348.     View=%view{ascii} mcmfmt < %f
  349.  
  350. # core
  351. shell/core
  352.  
  353. # Makefile
  354. regex/[Mm]akefile
  355.     Open=make -f %f %{Enter parameters}
  356.  
  357. # Imakefile
  358. shell/Imakefile
  359.     Open=xmkmf -a
  360.  
  361. # Executables
  362. type/\ executable
  363.     Open=./%f
  364.     Drop=%f %q
  365.     Execute in XTerm=xterm -e %f &
  366.     View Required Libraries=%view{ascii} ldd %f
  367.     Strip binary=strip %f
  368.  
  369. # dbf
  370. regex/\.(dbf|DBF)$
  371.        Open=%view{ascii} dbview %f
  372.        View=%view{ascii} dbview -b %f
  373.  
  374. # REXX script
  375. regex/\.(rexx|rex|cmd)$
  376.        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
  377.  
  378.  
  379. ### Archives ###
  380.  
  381. # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
  382. regex/\.t([gp]?z|ar\.g?[zZ])$
  383.     Open=%cd %p#utar
  384.     View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
  385.     Extract=gzip -dc %f 2>/dev/null | tar xf -
  386. regex/\.tar\.bz$
  387.     # Open=%cd %p#utar
  388.     View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
  389.     Extract=bzip -dc %f 2>/dev/null | tar xf -
  390. regex/\.tar\.bz2$
  391.     Open=%cd %p#utar
  392.     View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
  393.     Extract=bzip2 -dc %f 2>/dev/null | tar xf -
  394.  
  395. # .tar.F - used in QNX
  396. regex/\.tar\.F$
  397.     # Open=%cd %p#utar
  398.     View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
  399.     Extract=freeze -dc %f 2>/dev/null | tar xf -
  400.  
  401. # tar
  402. regex/\.(tar|TAR)$
  403.     Open=%cd %p#utar
  404.     View=%view{ascii} tar tvvf %f
  405.     Extract=tar xf %f
  406.  
  407. # zip
  408. regex/\.(zip|ZIP|jar|JAR)$
  409.     Open=%cd %p#uzip
  410.     View=%view{ascii} unzip -v %f
  411.     Extract=unzip %f
  412.     Extract (with flags)=I=%{Enter any Unzip flags:}; if test -n "$I"; then unzip $I %f; fi
  413.     Unzip=unzip %f '*'
  414.  
  415. # zoo
  416. regex/\.(zoo|ZOO)$
  417.     Open=%cd %p#uzoo
  418.     View=%view{ascii} zoo l %f
  419.     Extract=zoo x %f '*'
  420.     
  421. # lha
  422. regex/\.(lha|LHA|lzh|LZH)$
  423.     Open=%cd %p#ulha
  424.     View=%view{ascii} lharc l %f
  425.     Extract=lharc x %f '*'
  426.     Extract (with flags)=I=%{Enter any LHarc flags:}; if test -n "$I"; then lharc x $I %f; fi
  427.  
  428. # arj
  429. regex/\.a(rj|[0-9][0-9])$
  430.     Open=%cd %p#uarj
  431.     View=%view{ascii} unarj l %f
  432.     Extract=unarj x %f '*'
  433.     Extract (with flags)=I=%{Enter any Unarj flags:}; if test -n "$I"; then unarj x $I %f; fi
  434.  
  435. # ha
  436. regex/\.(ha|HA|Ha)$
  437.     Open=%cd %p#uha
  438.     View=%view{ascii} ha lf %f
  439.     Extract=ha xy %f '*'
  440.     Extract (with flags)=I=%{Enter any HA flags:}; if test -n "$I"; then ha xy $I %f; fi
  441.  
  442. # rar
  443. regex/\.[rR]([aA][rR]|[0-9][0-9])$
  444.     Open=%cd %p#urar
  445.     View=%view{ascii} rar v -c- %f
  446.     Extract=rar x -c- %f '*'
  447.     Extract (with flags)=I=%{Enter any RAR flags:}; if test -n "$I";then rar x $I %f; fi
  448.  
  449. # cpio
  450. shell/.cpio.Z
  451.     Open=%cd %p#ucpio
  452.     View=%view{ascii} compress -dc '%f' | cpio -ictv
  453.     Extract=compress -dc '%f' | cpio -ic
  454. shell/.cpio.gz
  455.     Open=%cd %p#ucpio
  456.     View=%view{ascii} gzip -dc '%f' | cpio -ictv
  457.     Extract=gzip -dc '%f' | cpio -ic
  458. shell/.cpio
  459.     Open=%cd %p#ucpio
  460.     View=%view{ascii} cat '%f' | cpio -ictv
  461.     Extract=cat '%f' | cpio -ic
  462.  
  463. # ls-lR
  464. regex/(^|\.)ls-?lR$
  465.     Open=%cd %p#lslR
  466. regex/(^|\.)ls-?lR\.(g?z|Z)$
  467.     Open=%cd %p#lslR
  468.     View=%view{ascii} gunzip -c %f
  469.  
  470. # ftplist
  471. regex/\.ftplist$
  472.     Open=%cd %p#ftplist
  473.  
  474. # gzip
  475. type/^gzip
  476.     Open=gzip -dc %f | %var{PAGER:more}
  477.     View=%view{ascii} gzip -dc %f 2>/dev/null
  478.     Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
  479.     Uncompress=gunzip %f
  480.  
  481. # bzip2
  482. type/^bzip2
  483.     Open=bzip2 -dc %f | %var{PAGER:more}
  484.     View=%view{ascii} bzip2 -dc %f 2>/dev/null
  485.     Edit=I=`date +%%s`; export I; bzip2 -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip2 -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
  486.     Uncompress=bunzip2 %f
  487.  
  488. # bzip
  489. type/^bzip
  490.     Open=bzip -dc %f | %var{PAGER:more}
  491.     View=%view{ascii} bzip -dc %f 2>/dev/null
  492.     Edit=I=`date +%%s`; export I; bzip -cd %f >/tmp/bzed.$I && %var{EDITOR:vi} /tmp/bzed.$I && bzip -c /tmp/bzed.$I > %f; rm -f /tmp/bzed.$I
  493.     Uncompress=bunzip %f
  494.  
  495. # compress
  496. type/^compress
  497.     Open=gzip -dc %f | %var{PAGER:more}
  498.     View=%view{ascii} gzip -dc %f 2>/dev/null
  499.     Edit=I=`date +%%s`; export I; gzip -cd %f >/tmp/gzed.$I && %var{EDITOR:vi} /tmp/gzed.$I && gzip -c /tmp/gzed.$I > %f; rm -f /tmp/gzed.$I
  500.  
  501. # ar library
  502. regex/\.s?a$
  503.     Open=%cd %p#uar
  504.     #Open=%view{ascii} ar tv %f
  505.     View=%view{ascii} nm %f
  506.  
  507. # trpm
  508. regex/\.trpm$
  509.     Open=%cd %p#trpm
  510.     View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
  511.  
  512. # Source RPMs (SuSE uses *.spm, others use *.src.rpm)
  513. regex/\.(spm|src\.rpm)$
  514.     Open=%cd %p#rpm
  515.     View=%view{ascii} rpm -qivlp --scripts %f
  516.     Install this RPM=rpm -i %f
  517.     Rebuild this RPM=rpm --rebuild %f
  518.     Check signature=rpm --checksig %f
  519.  
  520. # Compiled RPMs
  521. regex/\.rpm$
  522.     Open=%cd %p#rpm
  523.     View=%view{ascii} rpm -qivlp --scripts %f
  524.     Install this RPM=rpm -i %f
  525.     Upgrade this RPM=rpm -U %f
  526.     Check signature=rpm --checksig %f
  527.  
  528. # deb
  529. regex/\.deb$
  530.     Open=%cd %p#deb
  531.     View=%view{ascii} dpkg-deb -c %f
  532.  
  533.  
  534. ### Directories ###
  535.  
  536. directory/^\.\.$
  537. directory/^News$
  538. directory/^Mail$
  539. directory/^\..*$
  540. directory/^.*$
  541.     Start XTerm here=cd %p; exec xterm &
  542.     Make tar.gz=I=%{Enter destination file name:}; if test -n "$I"; then tar cvf - %p | gzip > $I; fi
  543.  
  544.  
  545. ### Default ###
  546.  
  547. # Default target for anything not described above
  548. default/*
  549.     Open=
  550.     View=
  551.     Drop=
  552.     Title=%p
  553.  
  554.  
  555. ### EOF ###
  556.